package com.bytz.modules.cms.order.model;


import com.bytz.modules.cms.order.entity.Order;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;


public class ImmutableOrder {

    /**
     * 产品线Code
     */
    public final String productLineCode;

    /**
     * 订单类别（1-标准订单；2-项目订单）
     */
    public final String orderType;

    /**
     * 增值税税率
     */
    public final BigDecimal taxRate;

    /**
     * 需方客户编码
     */
    public final String demanderNumber;

    /**
     * 需方交付客户编码
     */
    public final String shipToNumber;


    /**
     * 终端客户编码
     */
    public final String endUserNumber;

    /**
     * 付款方式
     */
    public final String payType;

    /**
     * 质保期
     */
    public final String warrantyPeriod;

    /**
     * 预付比例
     */
    public final BigDecimal prepayRatio;

    /**
     * 提交时预付比例
     */
    public final BigDecimal submitPrepayRatio;

    /**
     * 订单标准交期（取订单产品最长的交期）
     */
    public final Integer deliveryDate;

    /**
     * 订单总额
     */
    public final BigDecimal totalPrice;

    /**
     * 抵扣金额
     */
    public final BigDecimal deductionPrice;

    /**
     * 毛利率
     */
    public final BigDecimal stfMargin;

    /**
     * 构造不可变Order
     *
     * @param order Order
     */
    public ImmutableOrder(AdminOrderModel order) {
        productLineCode = order.getProductLineCode();
        orderType = order.getOrderType();
        taxRate = order.getTaxRate();
        demanderNumber = order.getDemanderNumber();
        shipToNumber = order.getShipToNumber();
        endUserNumber = order.getEndUserNumber();
        payType = order.getPayType();
        warrantyPeriod = order.getWarrantyPeriod();
        prepayRatio = order.getPrepayRatio();
        deliveryDate = order.getDeliveryDate();
        totalPrice = order.getTotalPrice();
        deductionPrice = order.getDeductionPrice();
        stfMargin = order.getStfMargin();
        submitPrepayRatio = order.getSubmitPrepayRatio();
    }
}